package com.bootcamp.idea1125.bean;

import lombok.Data;

/**
 * @program: MyMavenProject
 * @description:
 * @author: Keyu Li
 * @create: 2021-11-23 20:04
 **/

@Data
public class BaseRespVO {
    Integer code;
    String msg;
    Object data;

    public BaseRespVO(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static BaseRespVO ok(){
        return new BaseRespVO(200,"succeed!",null);
    }

    public static BaseRespVO ok(Object data){
        return new BaseRespVO(200,"succeed!",data);
    }

    public static BaseRespVO error(){
        return new BaseRespVO(500,"fail!",null);
    }

    public static BaseRespVO error(String msg){
        return new BaseRespVO(500,msg,null);
    }
}
